var Settle = (function ($) {
    return {
        initIndex: function () {
            Settle.initDateRangePicker();
        },
        initDateRangePicker: function () {
            dateRangePicker = $('#fromdate, #todate').daterangepicker({
                buttonImage: '/content/images/calendar.gif',
                dateFormat: 'yy-mm-dd',
                datepickerOptions: {
                    showOtherMonths: true,
                    changeMonth: true,
                    changeYear: true,
                    selectOtherMonths: true,
                    closeText: 'OK'
                }
            });
        },
        initDatePicker: function () {
            dateRangePicker = $('#open_date').datepicker({
                showOn: "both",
                buttonImage: '/content/images/calendar.gif',
                dateFormat: 'yy-mm-dd',
                onSelect: function (dateText) {
                    location.href = "index.php/admin/settle/settle?open_date=" + $("#open_date").val();
                }
            });
        },

        initSettle: function () {
            Settle.initDatePicker();
            $("input.channel-group").checkboxgroup();
        }
    };
})(jQuery);
